package com.sls.game.dao.nutsnet.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.sls.game.dao.impl.SuperDAO;
import com.sls.game.dao.nutsnet.AccountTypeDAO;
import com.sls.game.pojo.nutsnet.AccountTypeInfo;

/**
 * 
 * @description 账户类型pojo DAO
 * @author Wangxuegang
 * @date 2012-11-1
 * 
 */
@Repository("accountTypeDAO")
public class AccountTypeDAOImpl extends SuperDAO<AccountTypeInfo> implements
		AccountTypeDAO {

	/**
	 * 记录插入
	 * 
	 * @param accountTypeInfo
	 */
	@Override
	public void insert(AccountTypeInfo accountTypeInfo) {
		this.getSqlSession().insert(
				"mybatis.xml.nutsNetAccountTypeMapper.insert", accountTypeInfo);
	}

	/**
	 * 查询账户类型信息
	 * 
	 * @param accountTypeInfo
	 * @return
	 */
	@Override
	public String queryAccountType(AccountTypeInfo accountTypeInfo) {
		String hidAccountType = this.getSqlSession().selectOne(
				"mybatis.xml.nutsNetAccountTypeMapper.queryAccountType",
				accountTypeInfo);
		return hidAccountType;
	}

	@Override
	public List<AccountTypeInfo> queryOneOrMoreAccount(
			AccountTypeInfo accountTypeInfo) {
		List<AccountTypeInfo> list = this.getSqlSession().selectList(
				"mybatis.xml.nutsNetAccountTypeMapper.queryAccount",
				accountTypeInfo);
		return list;
	}

	/**
	 * 删除记录
	 * 
	 * @param id
	 */
	@Override
	public void deleteById(String id) {
		this.getSqlSession().delete(
				"mybatis.xml.nutsNetAccountTypeMapper.deleteById", id);
	}
}
